<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<jsp:include page="../../common/header.jsp"/>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<html>
<head>
<script type="text/javascript">
	function check() {
		document.getElementById('ok').disabled = 'disabled';
	}

	function backcompanyRolelist() {
	$("#companyroleform").attr("action","<%=request.getContextPath()%>/sso/company_role/list");
	$("#companyroleform").submit();
	}
</script>
</head>
<body class="page-header-fixed page-full-width">
		<div class="page-content">

			<div class="container-fluid">
				<div class="row-fluid">

					<div class="span12">


						<h3 class="page-title">

							<!--系统用户管理 <small>欢迎您，admin!</small> -->

						</h3>

						<ul class="breadcrumb">

							<li><i class="icon-home"></i> <a href="index.html">Home</a>

								<i class="icon-angle-right"></i></li>

							<li><a href="#">单点登录系统</a> <i class="icon-angle-right"></i>

							</li>

							<li><a href="#">企业角色</a></li>

						</ul>



					</div>

				</div>

				<div class="portlet-body form">

					<c:if test="${success==false}">
						<div class="alert alert-failure">
							<button class="close" data-dismiss="alert"></button>
							<strong><spring:message code="failure"></spring:message>!</strong>
							${errorMsg}
						</div>
					</c:if>
					<c:if test="${success }">
						<div class="alert alert-success">
							<button class="close" data-dismiss="alert"></button>
							<strong><spring:message code="success"></spring:message>!</strong>
							<spring:message code="save success"></spring:message>
							!
						</div>
					</c:if>
                     
					<h3 class="page-title">
						<c:if test="${oauthCompanyRole.oauthCompanyRoleId==null }">
							新增企业角色
						</c:if>
						<c:if test="${oauthCompanyRole.oauthCompanyRoleId!=null }">
							编辑企业角色
						</c:if>
					</h3>


					<form
						action="<c:if test="${oauthCompanyRole.oauthCompanyRoleId==null}">insert</c:if>
				    <c:if test="${oauthCompanyRole.oauthCompanyRoleId!=null}">edit</c:if>"
						method="post" class="form-horizontal" id="companyroleform"
						onsubmit="return check();">
						<input type="hidden" name="searchValue" value="${searchValue}" /><!-- company_code -->
						<input type="hidden" name="cList" value="${company_list}" /><!-- company company_code -->
						<input type="hidden" name="id"
							value="${oauthCompanyRole.oauthCompanyRoleId}"></input> <input
							type="hidden" name="token" value="${token}"></input>

						<div class="control-group">
							<label class="control-label">角色名：</label>
							<div class="controls">
								<input type="text" maxLength="200"
									<c:if test="${oauthCompanyRole.oauthCompanyRoleId!=null}">disabled="disabled"</c:if>
									name="roleName" value="${oauthCompanyRole.roleName }"
									class="m-wrap" required />
								<c:if test="${oauthCompanyRole.oauthCompanyRoleId!=null}">
									<input type="hidden" name="roleName"
										value="${oauthCompanyRole.roleName }"></input>
								</c:if>

								<span class="help-inline"></span>

							</div>

						</div>
						
						
						


						<div class="control-group">
							<label class="control-label">备注：</label>
							<div class="controls">

								<input type="text" maxlength="200" name="sremark"
									value="${oauthCompanyRole.sremark}" class="m-wrap" required />
								<span class="help-inline"></span>

							</div>

						</div>

						<div class="control-group">
							<label class="control-label">企业编号:</label>
							<div class="controls">
								<select tabindex="1" data-placeholder="Choose a companyCode"
									class="span2 m-wrap" name="companyCode">
									<option value=""></option>
									<c:forEach var="company" items="${company_list}">
										<option
											<c:if test="${searchValue==company.companyCode}">selected="selected"</c:if>
											value="${company.companyCode}">${company.companyCode}</option>
									</c:forEach>
								</select>
							</div>
						</div>


						<div class="form-actions">
							<button type="submit" id="ok" class="btn blue">
								<spring:message code="btn.common.save"></spring:message>
							</button>
							<button type="button" onclick="backcompanyRolelist();"
								class="btn">
								<spring:message code="btn.common.back"></spring:message>
							</button>

						</div>

					</form>

				</div>



			</div>
		</div>



</body>
</html>